import { BasicColumn, FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '服务名',
    dataIndex: 'serverName',
    width: 200,
  },
  {
    title: '路由ID',
    dataIndex: 'id',
    width: 200,
  },
  {
    title: '路由LB',
    dataIndex: 'uri',
    width: 200,
  },
  {
    title: '排序',
    dataIndex: 'order',
    width: 200,
  },
];
export const searchFormSchema: FormSchema[] = [
  {
    field: 'serverName',
    label: '服务名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'id',
    label: '路由ID',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'isUpdate',
    label: '是否修改',
    component: 'Input',
    ifShow: false,
  },
  {
    field: 'serverName',
    label: '服务名',
    required: true,
    component: 'Input',
  },
  {
    field: 'id',
    label: '路由ID',
    required: true,
    component: 'Input',
  },
  {
    field: 'uri',
    label: '路由LB',
    required: true,
    component: 'Input',
    componentProps: {
      //addonBefore: 'lb://',
      defaultValue: 'lb://',
    },
  },
  {
    field: 'order',
    label: '排序',
    required: true,
    component: 'InputNumber',
  },
];
